<template>
  <div class="invite-user f-g f-c">
    <el-tabs v-model="activeName">
      <el-tab-pane v-if="true || currentDetail.status == 4" label="人员组织、会议确认" name="UserInvite" />
      <el-tab-pane v-if="true || currentDetail.status && currentDetail.status > 4" label="人员参与情况" name="UserAccept" />
    </el-tabs>
      <UserInvite v-if="activeName === 'UserInvite'" :current-detail="currentDetail" @success="onSuccess"/>
      <UserAccept v-if="activeName === 'UserAccept'" :current-detail="currentDetail" @success="onSuccess"/>
  </div>
</template>

<script>
import UserInvite from './user-invite'
import UserAccept from './user-accept'
export default {
  name: 'First',
  components: {
    UserInvite,
    UserAccept
  },
  props: {
    currentDetail: Object
  },
  data() {
    return {
      activeName: 'UserInvite',
      professorList: [],
      deptList: []
    }
  },
  watch: {
    currentDetail: {
      handler() {
        if (this.currentDetail.status && this.currentDetail.status > 4) {
          this.activeName = 'UserAccept'
        } else {
          this.activeName = 'UserInvite'
        }
      },
      deep: true,
      immediate: true
    }
  },
  methods: {
    onSuccess() {
      this.$emit('success')
    }
  }
}
</script>

<style lang="scss">
.invite-user {
    overflow: hidden;
}
</style>
